package com.oriole.admin.feign;

import com.oriole.common.constant.ResultModel;
import com.oriole.entity.sys.SysUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author doublelife
 * Email: hautxxxyzjk@163.com
 * Date: 2019-04-02
 * Time: 19:55
 * Description:
 */
@FeignClient("oriole-api")
public interface ISysUserService {

    @PostMapping("/api/sysUser/save")
    ResultModel<SysUser> save(@RequestBody SysUser sysUser);

    @PutMapping("/api/sysUser/update")
    ResultModel<SysUser> update(@RequestBody SysUser sysUser);

    @DeleteMapping("/api/sysUser/delete/{id}")
    ResultModel<Object> deleteById(@PathVariable("id") Long id);

    @DeleteMapping("/api/sysUser/deleteBatchByIds")
    ResultModel<Object> deleteBatchByIds(List<Long> ids);

    @GetMapping("/api/sysUser/findAll")
    ResultModel<List<SysUser>> findAll();

    @GetMapping("/api/sysUser/findPage")
    ResultModel<Object> findPage(Pageable pageable);

    @GetMapping("/api/sysUser/findByUsername")
    ResultModel<SysUser> findByUsername(@RequestParam("username") String username);

    @GetMapping("/api/sysUser/find/{id}")
    ResultModel<SysUser> findById(@PathVariable("id") Long id);

}
